ethersphere / bee-factory Goto Github PK
View Code? Open in Web Editor NEWBuilds up a test environment with Bee clients and with a test blockchain.
License: BSD 3-Clause "New" or "Revised" License
Builds up a test environment with Bee clients and with a test blockchain.
License: BSD 3-Clause "New" or "Revised" License
We need to be able to reset the funds of the nodes. Currently --ephemeral
flag won't persist changes in Bee's containers, but the token transfers are persisted. This I think can create inconsistencies. I think it would be good idea to propagate the --ephemeral
flag to blockchain container as well.
We have in the packageJson.engines.bee
specified Bee version against which runs the integration tests. As we already automatically build new Bee images there could be part of the CI job that also bumps this version and create PR.
It should be pretty easy to deploy ENS suite to Ganache which would enable testing and development with ENS names. Only question is how the domain names would be managed in some form of UI.
Node 17 now defaults to IPv6 for DNS resolution (eq. for localhost
it will use ::1
). Bee's instances spawned with Bee Factory are not listening on ::1
which might create hard-to-debug problems for users. Workaround is to not use localhost
but directly 127.0.0.1
but people has to know about this. Would be easier to support listening on ::1
instead.
When starting the environment I got an error. It seems that returned value for the check was not a valid JSON and it got stuck in that state.
% ./scripts/environment.sh start
Create Docker network...
Start Blockchain node...
b322626d20ce
Start Bee nodes...
34d93cf62eed
b94088d29547
ae540643bfb0
f606889e7700
5776154b57a6
Check whether the queen node has been connected to every worker...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Only peers have been connected to the Queen Bee node yet. Waiting until 4
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 291, in load
**kw)
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Only peers have been connected to the Queen Bee node yet. Waiting until 4
Allow to specify images and versions that Bee Factory should run from places like:
.bee-factory
package.json
I have some problems trying to run the bee-factory. I follow the steps mentioned in the readme for setting up the environment. All previous steps seem correct:
./scripts/network.sh
./scripts/blockchain.sh
npm run migrate:contracts
npm run supply
When I execute ./scripts/bee.sh start, the queen node does not initialize. When I go to the test-queen container logs I see the following:
time="2021-06-14T13:29:40Z" level=info msg="version: 0.6.0-67cc8f24"
time="2021-06-14T13:29:40Z" level=warning msg="clef is not enabled; portability and security of your keys is sub optimal"
time="2021-06-14T13:29:40Z" level=info msg="using existing swarm network address: 689a7bc16ea0291977f77b33403a4cd3e776d9a19f47ba0b66634359983d1cd4"
time="2021-06-14T13:29:40Z" level=info msg="swarm public key 03d5f6051105af2bc1dfb657031fc9d10df9be44ed24608e730a9a0cd07c97e906"
time="2021-06-14T13:29:40Z" level=debug msg="using existing libp2p key"
time="2021-06-14T13:29:40Z" level=debug msg="using existing pss key"
time="2021-06-14T13:29:40Z" level=info msg="pss public key 02f20bfb14a31491f8a9aec2dc455be4353733040e921ececcf612aca735b0bc7c"
time="2021-06-14T13:29:40Z" level=info msg="using ethereum address 26234a2ad3ba8b398a762f279b792cfacd536a3f"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x11141cb]
I am running:
Now Bee Docker images are released for multiple architectures that also include ARM based platforms that are needed for the Apple M1, so it would be awesome to have support for this.
When running the environment.sh
script without arguments I get the following error:
% ./scripts/environment.sh
./scripts/environment.sh: line 51: echoerr: command not found
By default there is no echoerr
command in bash. It seems that this function could work instead:
echoerr() {
>&2 echo "$@"
}
eysir@eysir-ubu:~/workspace/golang/bee-factory$ npm run migrate:contracts
> [email protected] migrate:contracts /home/eysir/workspace/golang/bee-factory
> truffle migrate
Compiling your contracts...
===========================
> Compiling ./contracts/ERC20PresetMinterPauser.sol
> Compiling @openzeppelin/contracts/access/AccessControl.sol
> Compiling @openzeppelin/contracts/math/SafeMath.sol
> Compiling @openzeppelin/contracts/presets/ERC20PresetMinterPauser.sol
> Compiling @openzeppelin/contracts/token/ERC20/ERC20.sol
> Compiling @openzeppelin/contracts/token/ERC20/ERC20Burnable.sol
> Compiling @openzeppelin/contracts/token/ERC20/ERC20Pausable.sol
> Compiling @openzeppelin/contracts/token/ERC20/IERC20.sol
> Compiling @openzeppelin/contracts/utils/Address.sol
> Compiling @openzeppelin/contracts/utils/Context.sol
> Compiling @openzeppelin/contracts/utils/EnumerableSet.sol
> Compiling @openzeppelin/contracts/utils/Pausable.sol
> Artifacts written to /home/eysir/workspace/golang/bee-factory/build/contracts
> Compiled successfully using:
- solc: 0.6.12+commit.27d51765.Linux.g++
TypeError: Db.connect is not a function
at Object.save (/home/eysir/workspace/golang/bee-factory/node_modules/truffle/build/webpack:/packages/workflow-compile/index.js:115:1)
Truffle v5.3.6 (core: 5.3.6)
Node v10.19.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] migrate:contracts: `truffle migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] migrate:contracts script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/eysir/.npm/_logs/2021-08-09T10_17_20_467Z-debug.log
This is Error info above.
And I follow this link: https://github.com/ethersphere/bee-factory
On the environment start workflow, the scripts awaits for the queen node to be initialized
Waiting for the Queen initialization...
it continuously asking the expected queen HTTP EP, and it does not stop even the queen node that already exited with an error.
If there is already running bee-factory start --detach
instance and the person forgets that it runs and wants to run bee-factory start --fresh
then instead of a recreation of the images, it attaches to the currently running cluster instead of erroring out.
For my Queen the command curl -s localhost:1635/addresses
gives:
{
"ethereum": "0x26234a2ad3ba8b398a762f279b792cfacd536a3f",
"overlay": "18d0987d8d012cd3ca589d2df13fa28eeb8961f543faeb5a991df8b6c4c25333",
"pssPublicKey": "02f20bfb14a31491f8a9aec2dc455be4353733040e921ececcf612aca735b0bc7c",
"publicKey": "03d5f6051105af2bc1dfb657031fc9d10df9be44ed24608e730a9a0cd07c97e906",
"underlay": [
"/ip4/172.18.0.3/tcp/1634/p2p/16Uiu2HAmBTraFFjULgNxfUm4DbCjuejN8KFhx9xAdE4kKRt82ccL",
"/ip4/127.0.0.1/tcp/1634/p2p/16Uiu2HAmBTraFFjULgNxfUm4DbCjuejN8KFhx9xAdE4kKRt82ccL"
]
}
which with the script: curl -s localhost:1635/addresses | python -mjson.tool 2>&1 | grep "/ip4/" | awk '!/127.0.0.1/' | xargs
I get:
"/ip4/172.18.0.3/tcp/1634/p2p/16Uiu2HAmBTraFFjULgNxfUm4DbCjuejN8KFhx9xAdE4kKRt82ccL",
Notice the trailing ,
which then throws error inside the Worker's Bees.
Right now, all postage stamps created in the bee-factory environment have batchTTL: -1
. There are two things that can cause this:
Very likely it is caused by 2, the chain state price being 0. I found out that the chain price contract differs to the one deployed to mainnet so that would be my guess.
sig :: Code/swarm/bee-factory » npm run migrate:contracts
...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
> Artifacts written to /Users/sig32/Code/swarm/bee-factory/build/contracts
> Compiled successfully using:
- solc: 0.6.12+commit.27d51765.Linux.g++
TypeError: Db.connect is not a function
at Object.save (/Users/sig32/Code/swarm/bee-factory/node_modules/truffle/build/webpack:/packages/workflow-compile/index.js:115:1)
at Object.compileAndSave (/Users/sig32/Code/swarm/bee-factory/node_modules/truffle/build/webpack:/packages/workflow-compile/index.js:100:1)
at Object.run (/Users/sig32/Code/swarm/bee-factory/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:199:1)
at Command.run (/Users/sig32/Code/swarm/bee-factory/node_modules/truffle/build/webpack:/packages/core/lib/command.js:147:1)
Truffle v5.3.6 (core: 5.3.6)
Node v16.14.0
It would be good to be able to build a Bee image from a given source tree. Maybe it's possible but I could not find out how.
The use case is when working on a new version that has not been released yet. For that it's possible to use the latest
tag to pull from docker, but the content of that image is mutable because it is pushed from the master, therefore it cannot be reliably used to reproduce issues between different developers.
After installing
npm install -g @ethersphere/bee-factory
it fails to start
bee-factory start
█ Failed to run command!
ENOENT: no such file or directory, open '/Users/vojtechsimetka/Swarm/gateway-proxy/.beefactory.json'
There is a need to have postage stamps on startup for the pre-defined overlay addresses.
Sometimes if there is some problem with configuration or problem with the bee it is not possible to say what is wrong as there is no logging output and the "Waiting for Queen" message is in an infinite loop. For example see: https://github.com/ethersphere/bee-js/pull/300/checks?check_run_id=2518709623
I would love some better way to debug these issues. Not sure why the logging output of Queen is suppressed? Maybe after some "soft-timeout" it could print out the logs? Or some other mechanism?
Problem:
When starting the bee factory on M1 mac, the queen bee starts before the blockchain is ready. This means it fails on connection to blockchain and the script is then stuck on the Waiting for the Queen initialization...
loop until it times out.
Proposed solution:
Only spawn bee nodes after getting non-zero block number from the blockchain backend.
Logs:
./scripts/environment.sh start --workers=1 --hostname=0.0.0.0 --ephemeral
Create Docker network...
Start Blockchain node...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
431d7b9b03b97313091a3c6c607aaa2cae25dbbe5b3a18f5ff83b1152823381f
Start Bee nodes...
start Bee Queen process
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
807f3947cb313f3575b5fd2e3ae517c19c7ce157f99fc93bfa33594e9e8ca848
No JSON object could be decoded
Waiting for the Queen initialization...
No JSON object could be decoded
Waiting for the Queen initialization...
...
Error: No such container: swarm-test-queen
Stop Bee following containers:
Error response from daemon: No such container: swarm-test-queen
Timeout limit has been reached, exit from the process..
swarm-test-blockchain
If the user does not purge the containers (eq using the --epheremal
or the new --fresh
flag) between launches of Bee Factory and then wants to upgrade to new versions of containers Bee Factory will error out as the container's image won't be as expected. For now, the workaround is to use the --fresh
flag when updating image versions, which will purge the containers before the launch, but a better UX alternative would be to prompt the user for confirmation if the image should be purged and then continue with start-up of the cluster.
./scripts/environment.sh start --workers=1 --hostname=0.0.0.0 --ephemeral
Create Docker network...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Creating swarm-test-network...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Start Blockchain node...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
waiting for blockchain service is up...
...
There is a need to add or remove worker nodes from the cluster on-demand.
The script should add Bee node(s) to the running cluster, but the bee version can differ from the other running nodes.
Removing docker node can happen via docker container stop <worker-node-name>
, but optionally, a script can be written for this use-case in the package.json
.
This change will allow to test Swarm network with mixed versioned Bee nodes which is closer to the reality.
Since the tests in the https://github.com/ethersphere/bee-js repo are run by bee-factory, the unit tests take longer to run. Even though the time to setup of the environment went down from ~3 minutes to ~1 minute, running the node unit tests take significantly longer (~5 minutes -> ~8 minutes)
When investigating the cause of the difference I found that previously the tests where we expect errors took 10 seconds and with bee-factory they take 20 seconds. Usually the multiplier of 10 seconds and the type of the tests indicate that this problem is related to some kind of Bee timeout. I don't know what is the root cause of that, but it would be good to investigate and understand. The real issue here is is that this timeout compounds so as we add more tests that rely on this timeouts will make the running the tests even longer.
This is the last successful test run with beekeper:
https://github.com/ethersphere/bee-js/runs/2437878849
And this is the first test run with bee-factory:
https://github.com/ethersphere/bee-js/runs/2517021936
statefull
? Or default to stateful?eysir@eysir-ubu:~/workspace/golang/bee-factory$ ./scripts/environment.sh start
Create Docker network...
Start Blockchain node...
cc58fe4eb469
Start Bee nodes...
6a4fff8de437
No JSON object could be decoded
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Welcome to Swarm.... Bzzz Bzzzz Bzzzz
\ /
\ o ^ o /
\ ( ) /
____________(%%%%%%%)____________
( / / )%%%%%%%( \ \ )
(___/___/__/ \__\___\___)
( / /(%%%%%%%)\ \ )
(__/___/ (%%%%%%%) \___\__)
/( )\
/ (%%%%%) \
(%%%)
!
version: 1.0.0-2572fa48 - planned to be supported until 1 April 1970, please follow http://ethswarm.org/
time="2021-08-10T01:13:05Z" level=warning msg="your node is outdated, please check for the latest version"
time="2021-08-10T01:13:05Z" level=warning msg="clef is not enabled; portability and security of your keys is sub optimal"
time="2021-08-10T01:13:05Z" level=info msg="swarm public key 03d5f6051105af2bc1dfb657031fc9d10df9be44ed24608e730a9a0cd07c97e906"
time="2021-08-10T01:13:05Z" level=debug msg="using existing libp2p key"
time="2021-08-10T01:13:05Z" level=debug msg="using existing pss key"
time="2021-08-10T01:13:05Z" level=info msg="pss public key 02f20bfb14a31491f8a9aec2dc455be4353733040e921ececcf612aca735b0bc7c"
time="2021-08-10T01:13:05Z" level=info msg="using ethereum address 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:13:05Z" level=info msg="version: 1.0.0-2572fa48"
time="2021-08-10T01:13:05Z" level=warning msg="no bootnodes defined for network ID4020"
time="2021-08-10T01:13:05Z" level=info msg="debug api address: [::]:1635"
time="2021-08-10T01:13:05Z" level=info msg="using custom factory address: 5b1869d9a4c187f2eaa108f3062412ecf0526b24"
time="2021-08-10T01:13:06Z" level=info msg="no chequebook found, deploying new one."
time="2021-08-10T01:13:06Z" level=warning msg="cannot continue until there is at least 1 BZZ available on 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:13:10Z" level=info msg="debug api access" duration=0.000283548 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:15Z" level=info msg="debug api access" duration=0.000117756 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:20Z" level=info msg="debug api access" duration=0.00012936 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:25Z" level=info msg="debug api access" duration=0.000122796 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:26Z" level=warning msg="cannot continue until there is at least 1 BZZ available on 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:13:30Z" level=info msg="debug api access" duration=0.0001136 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:35Z" level=info msg="debug api access" duration=0.000147964 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:40Z" level=info msg="debug api access" duration=0.000111173 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:45Z" level=info msg="debug api access" duration=0.000119496 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:46Z" level=warning msg="cannot continue until there is at least 1 BZZ available on 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:13:50Z" level=info msg="debug api access" duration=8.9089e-05 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:13:55Z" level=info msg="debug api access" duration=0.000144006 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:00Z" level=info msg="debug api access" duration=0.000126914 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:05Z" level=info msg="debug api access" duration=0.000108269 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:06Z" level=warning msg="cannot continue until there is at least 1 BZZ available on 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:14:10Z" level=info msg="debug api access" duration=0.000107683 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:15Z" level=info msg="debug api access" duration=0.000100009 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:20Z" level=info msg="debug api access" duration=0.000103493 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:25Z" level=info msg="debug api access" duration=9.315e-05 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:26Z" level=warning msg="cannot continue until there is at least 1 BZZ available on 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:14:31Z" level=info msg="debug api access" duration=9.629e-05 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:36Z" level=info msg="debug api access" duration=8.6996e-05 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:41Z" level=info msg="debug api access" duration=0.000106989 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:46Z" level=info msg="debug api access" duration=0.00011505 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:46Z" level=warning msg="cannot continue until there is at least 1 BZZ available on 26234a2ad3ba8b398a762f279b792cfacd536a3f"
time="2021-08-10T01:14:51Z" level=info msg="debug api access" duration=0.000115758 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:14:56Z" level=info msg="debug api access" duration=0.000100997 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
time="2021-08-10T01:15:01Z" level=info msg="debug api access" duration=0.000112633 ip=172.19.0.1 method=GET proto=HTTP/1.1 size=253 status=200 uri=/addresses user-agent=curl/7.68.0
Stop Bee following containers:
swarm-test-queen
Timeout limit has been reached, exit from the process..
swarm-test-blockchain
Anyone knows what's wrong with it? Why timeout?
It is quite obvious to the user which version of the Bee's images (queen & workers) to run (especially after the #78 is implemented) as it translates to which "Bee version" they want to run. The thing which is non-trivial to figure out is what Blockchain image version they should run.
We could bundle this information directly to the Bee's images (most sense makes to put it to the Queen image) using the Docker LABEL
s where the CLI would:
sudo run supply
:Supplying address 0x118c2c5d4b9cea2eaebca8ef4a3402c79b795cf5 with Token from account 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1 was successful!
Given Token Amount: 100
Transaction ID: 0x10a34162e9977597777a16701132dfc443330ae2a864dc5a1865c6a16c8f91d2
...
other address
...
Supplying address 0x118c2c5d4b9cea2eaebca8ef4a3402c79b795cf5 with Ether from account 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1 was successful!
Given Ether Amount: 1
Transaction ID: 0x9c75db849c1ad5f72bdd0f013939a1a599a63673e29104b4864234c43e1d60af
curl localhost:51635/addresses | jq
0x118c2c5d4b9cea2eaebca8ef4a3402c79b795cf5
{
"overlay": "49d5cb3ab5c6c703c6e77d0c82fa3f0fcb7d72a4ce1d1945701ea63033a732e9",
"underlay": [
"/ip4/172.31.16.78/tcp/51634/p2p/16Uiu2HAmSABUuwprQKbvn82TCWwU4wCp5zyheC4Le2VGUe2bYGdh",
"/ip4/127.0.0.1/tcp/51634/p2p/16Uiu2HAmSABUuwprQKbvn82TCWwU4wCp5zyheC4Le2VGUe2bYGdh",
"/ip6/::1/tcp/51634/p2p/16Uiu2HAmSABUuwprQKbvn82TCWwU4wCp5zyheC4Le2VGUe2bYGdh"
],
"ethereum": "0x118c2c5d4b9cea2eaebca8ef4a3402c79b795cf5",
"publicKey": "0255e1fdb280cdd802114b77640398ea4ba1c2067dcd2c2a9bd8eed933e7ecff0f",
"pssPublicKey": "02b3c3444af4244a118ce2a76d85a8581861d8afe5fd82d77b19b4bc25f08c4332"
}
curl localhost:51635/chainstate
to check balance, it shows:{"block":1397,"totalAmount":"0","currentPrice":"0"}
Any suggestion? Much appreciated in advance:)
Right now, when I want to switch between Bee version 0.5.3
and 0.6.0
, I need to remove the docker images and rebuild the whole environment. It would be much better if the docker images contained the version and I could keep several versions at the same time and just spawn them.
By merging #58 PR, the bee-factory
is triggered on Bee releases and creates stateful Bee images then triggers dependant repositories to use that.
On Bee release trigger, we could also have a stateless build of Bee image and create a chore: bump bee_version
PR that bumps the BEE_VERSION
default value of the configuration file
When deploying the contracts for the second time, it should not need to again compile them. Truffle can recognize contracts have been compiled, they probably just need to be correctly mounted to the corresponding docker image.
bee.sh
fairos.sh
Currently, it is possible to have only maximum 5 nodes in a bee-factory
network, because there wasn't any JS lib that could generate swarm.key
format key, thereby, there were pre-generated swarm keys for 5 nodes.
The new V3 compatible keys in Bee opened the gate to generate V3 format keys for nodes with a JS lib (or with swarm-cli
). These keys can be placed into the keys
folder under each Bee data dir before spinning up the Bee instances with docker.
It allows to import/handle the keys easily in other environment and have tests more interactive.
Currently, Bee Factory automatically spawns 4 Bee Worker nodes, which might not be needed for the user's need and for weaker PCs this help to elevate some load.
eysir@eysir-ubu:~/workspace/golang/bee-factory$ ./scripts/bee.sh start --workers=4
start Bee Queen process
5c45909d0c6ac1d6a718372d792e23d1bbe239f343b66e3f227d2cced33cebec
No JSON object could be decoded
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Waiting for the Queen initialization...
Queen underlay address: /ip4/172.19.0.3/tcp/1634/p2p/16Uiu2HAmBTraFFjULgNxfUm4DbCjuejN8KFhx9xAdE4kKRt82ccL
start Bee worker 1 process
f48aac36e34095e0be50b102ae08625c64120ff7ceb4cc1f5aaa8d4335be59fc
start Bee worker 2 process
51b586fc3032a937c3f98e9db8f788b22f351f5417b070e53f84fd47e9b53f3c
start Bee worker 3 process
5d9077964c609efc2bebb8e551b4ad345fcd4ab4ca2eaaf9cf38cacbf262216d
start Bee worker 4 process
42ae16419f998539299dc512ff56fcbb06d16532f2d88d7af0ed3dd679fdefc0
Check whether the queen node has been connected to every worker...
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: object of type 'NoneType' has no len()
Only 0 peers have been connected to the Queen Bee node yet. Waiting until 4
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: object of type 'NoneType' has no len()
Only 0 peers have been connected to the Queen Bee node yet. Waiting until 4
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: object of type 'NoneType' has no len()
Only 0 peers have been connected to the Queen Bee node yet. Waiting until 4
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: object of type 'NoneType' has no len()
Only 0 peers have been connected to the Queen Bee node yet. Waiting until 4
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: object of type 'NoneType' has no len()
Only 0 peers have been connected to the Queen Bee node yet. Waiting until 4
And, what's wrong?
It seems that Bee Factory fails for some reason on Node 18, but only in CI (locally it works for me). The surprising part was that the failing of spinning the Bee Factory was not marked with error in CI. It looks like the furious-commander
might not be setting proper exit code?
I'm trying to run the migrate:contracts command but I get an error:
% npm run migrate:contracts
> [email protected] migrate:contracts /Users/attila/Projects/bee-factory
> truffle migrate
Compiling your contracts...
===========================
> Compiling ./contracts/ERC20PresetMinterPauser.sol
> Compiling @openzeppelin/contracts/access/AccessControl.sol
> Compiling @openzeppelin/contracts/math/SafeMath.sol
> Compiling @openzeppelin/contracts/presets/ERC20PresetMinterPauser.sol
> Compiling @openzeppelin/contracts/token/ERC20/ERC20.sol
> Compiling @openzeppelin/contracts/token/ERC20/ERC20Burnable.sol
> Compiling @openzeppelin/contracts/token/ERC20/ERC20Pausable.sol
> Compiling @openzeppelin/contracts/token/ERC20/IERC20.sol
> Compiling @openzeppelin/contracts/utils/Address.sol
> Compiling @openzeppelin/contracts/utils/Context.sol
> Compiling @openzeppelin/contracts/utils/EnumerableSet.sol
> Compiling @openzeppelin/contracts/utils/Pausable.sol
> Artifacts written to /Users/attila/Projects/bee-factory/build/contracts
> Compiled successfully using:
- solc: 0.6.12+commit.27d51765.Linux.g++
TypeError: Db.connect is not a function
at Object.save (/Users/attila/Projects/bee-factory/node_modules/truffle/build/webpack:/packages/workflow-compile/index.js:115:1)
at Object.compileAndSave (/Users/attila/Projects/bee-factory/node_modules/truffle/build/webpack:/packages/workflow-compile/index.js:100:1)
at Object.run (/Users/attila/Projects/bee-factory/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:199:1)
at Command.run (/Users/attila/Projects/bee-factory/node_modules/truffle/build/webpack:/packages/core/lib/command.js:147:1)
Truffle v5.3.6 (core: 5.3.6)
Node v14.16.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] migrate:contracts: `truffle migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] migrate:contracts script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/attila/.npm/_logs/2021-06-01T15_24_01_947Z-debug.log
Exit 1
One nice feature of the bee.sh
script we had in bee-js
was that you just run it and it worked. I understand that bee-factory does have way more functionalities, but as a developer I don't really care, all I want is to run the environment for tests.
It would be great to have one single command to completely bootstrap the environment (building images, starting the network, deploying...). Or at least clarify the readme a bit more and put the different commands into the package.json
just as the build:env
and publish:env
for example are.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.