Bump test genesis token amount

This commit is contained in:
Łukasz Magiera 2019-09-24 12:30:48 +02:00
parent a21846aa6e
commit 5fa1a74e74
8 changed files with 21 additions and 28 deletions

View File

@ -5,7 +5,7 @@ package build
const UnixfsChunkSize uint64 = 1 << 20
const UnixfsLinksPerLevel = 1024
const SectorSize = 1024
const SectorSize = 16 << 20
// Blocks
const PaymentChannelClosingDelay = 6 * 60 * 2 // six hours

View File

@ -202,7 +202,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
// TODO: hardcoding 7000000 here is a little fragile, it changes any
// time anyone changes the initial account allocations
rval, err := doExecValue(ctx, vm, actors.StorageMarketAddress, owner, types.NewInt(7000000), actors.SMAMethods.CreateStorageMiner, params)
rval, err := doExecValue(ctx, vm, actors.StorageMarketAddress, owner, types.NewInt(700000000), actors.SMAMethods.CreateStorageMiner, params)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to create genesis miner: %w", err)
}

View File

@ -84,16 +84,13 @@ class Address extends React.Component {
return info
}
add200k = async () => {
[...Array(10).keys()].map(() => async () => await this.props.add20k(this.props.addr)).reduce(async (p, c) => [await p, await c()], Promise.resolve(null))
}
render() {
let add20k = <span/>
if(this.props.add20k) {
add20k = <span>&nbsp;<a href="#" onClick={() => this.props.add20k(this.props.addr)}>[+20k]</a></span>
if(this.props.addN) {
add20k = <span>&nbsp;<a href="#" onClick={() => this.props.addN(this.props.addr, 200000)}>[+200k]</a></span>
if (this.props.add10k) {
add20k = <span>{add20k}&nbsp;<a href="#" onClick={this.add200k}>[+200k]</a></span>
add20k = <span>{add20k}&nbsp;<a href="#" onClick={() => this.props.addN(this.props.addr, 2000000)}>[+2M]</a></span>
add20k = <span>{add20k}&nbsp;<a href="#" onClick={() => this.props.addN(this.props.addr, 20000000)}>[+20M]</a></span>
}
}
let addr = truncAddr(this.props.addr, this.props.short ? 12 : 17)

View File

@ -15,7 +15,6 @@ class FullNode extends React.Component {
this.newSecpAddr = this.newSecpAddr.bind(this)
this.newBLSAddr = this.newBLSAddr.bind(this)
this.startStorageMiner = this.startStorageMiner.bind(this)
this.add20k = this.add20k.bind(this)
this.explorer = this.explorer.bind(this)
this.client = this.client.bind(this)
this.stop = this.stop.bind(this)
@ -84,10 +83,6 @@ class FullNode extends React.Component {
this.props.spawnStorageNode(this.props.node.Repo, this.props.client)
}
async add20k(to) {
await this.props.give20k(to)
}
explorer() {
this.props.mountWindow((onClose) => <ChainExplorer onClose={onClose} ts={this.state.tipset} client={this.props.client} mountWindow={this.props.mountWindow}/>)
}
@ -123,14 +118,14 @@ class FullNode extends React.Component {
let storageMine = <a href="#" onClick={this.startStorageMiner} hidden={!this.props.spawnStorageNode}>[Spawn Storage Miner]</a>
let addresses = this.state.addrs.map((addr) => {
let line = <Address client={this.props.client} add20k={this.add20k} add10k={true} nonce={true} addr={addr} mountWindow={this.props.mountWindow}/>
let line = <Address client={this.props.client} addN={this.props.giveN} add10k={true} nonce={true} addr={addr} mountWindow={this.props.mountWindow}/>
if (this.state.defaultAddr === addr) {
line = <b>{line}</b>
}
return <div key={addr}>{line}</div>
})
let paychannels = this.state.paychs.map((addr, ak) => {
const line = <Address client={this.props.client} add20k={this.add20k} add10k={true} addr={addr} mountWindow={this.props.mountWindow}/>
const line = <Address client={this.props.client} addN={this.addN} add10k={true} addr={addr} mountWindow={this.props.mountWindow}/>
const vouchers = this.state.vouchers[ak].map(voucher => {
let extra = <span></span>
if(voucher.Extra) {

View File

@ -27,7 +27,7 @@ class NodeList extends React.Component {
this.spawnStorageNode = this.spawnStorageNode.bind(this)
this.connMgr = this.connMgr.bind(this)
this.consensus = this.consensus.bind(this)
this.transfer20kFrom1 = this.transfer20kFrom1.bind(this)
this.transferNFrom1 = this.transferNFrom1.bind(this)
this.getNodes()
}
@ -52,7 +52,7 @@ class NodeList extends React.Component {
node={{...node}}
client={client}
pondClient={this.props.client}
give20k={this.transfer20kFrom1}
giveN={this.transferNFrom1}
mountWindow={this.props.mountWindow}
spawnStorageNode={this.spawnStorageNode}
stop={this.stopNode(node.ID, onClose)}
@ -81,7 +81,7 @@ class NodeList extends React.Component {
this.setState({existingLoaded: true, nodes: nodes})
}
async transfer20kFrom1(to) {
async transferNFrom1(to, n) {
const addrss = await this.state.nodes[1].conn.call('Filecoin.WalletList', [])
const [bestaddr, bal] = await addrss.map(async addr => {
let balance = 0
@ -96,7 +96,7 @@ class NodeList extends React.Component {
await pushMessage(this.state.nodes[1].conn, bestaddr, {
To: to,
From: bestaddr,
Value: "20000",
Value: String(n),
})
}

View File

@ -8,10 +8,11 @@ const stateConnecting = 'connecting'
const stateGettingToken = 'getting-token'
let sealCodes = [
'Sealed',
'Pending',
'Failed',
'Sealing'
"Unknown",
"Pending",
"Failed",
"Sealing",
"Sealed",
]
class StorageNode extends React.Component {
@ -116,7 +117,7 @@ class StorageNode extends React.Component {
<div>{this.state.statusCounts.map((c, i) => <span key={i}>{sealCodes[i]}: {c} | </span>)}</div>
<div>
{this.state.staged ? this.state.staged.map((s, i) => (
<div key={i}>{s.SectorID} {sealCodes[s.SealStatusCode]}</div>
<div key={i}>{s.SectorID} {sealCodes[s.State]}</div>
)) : <div/>}
</div>

View File

@ -34,7 +34,7 @@ func (sm *StorageMinerAPI) StoreGarbageData(ctx context.Context) (uint64, error)
size := sectorbuilder.UserBytesForSectorSize(build.SectorSize)
name := fmt.Sprintf("fake-file-%d", rand.Intn(100000000))
sectorId, err := sm.Sectors.AddPiece(name, size, io.LimitReader(rand.New(rand.NewSource(42)), 1016))
sectorId, err := sm.Sectors.AddPiece(name, size, io.LimitReader(rand.New(rand.NewSource(42)), int64(size)))
if err != nil {
return 0, err
}

View File

@ -40,7 +40,7 @@ func MakeGenesisMem(out io.Writer) func(bs dtypes.ChainBlockstore, w *wallet.Wal
PeerIDs: []peer.ID{"peerID 1"},
}
alloc := map[address.Address]types.BigInt{
w: types.NewInt(10000000),
w: types.NewInt(1000000000),
}
b, err := gen.MakeGenesisBlock(bs, alloc, gmc, 100000)
@ -76,7 +76,7 @@ func MakeGenesis(outFile string) func(bs dtypes.ChainBlockstore, w *wallet.Walle
}
addrs := map[address.Address]types.BigInt{
minerAddr: types.NewInt(50000000),
minerAddr: types.NewInt(5000000000),
}
b, err := gen.MakeGenesisBlock(bs, addrs, gmc, 100000)