Coder Social home page Coder Social logo

wiki's Introduction

wiki's People

Contributors

athrunarthur avatar bibibong avatar chengorangeju avatar dreamflyfengzi avatar dz85 avatar fbzhong avatar gertig avatar hermantnet avatar kvakirsanov avatar leonli000 avatar maartendq avatar magazmj avatar magicstuff avatar mynamepfd avatar nebulashub avatar ottokafka avatar pluohust avatar qywang2012 avatar royshang avatar samuelchen85 avatar silentttttt avatar smalloranges avatar tianlongzu avatar uynarud avatar victorychain avatar xatmassacre avatar yangmaojun avatar yupnano avatar zhuqicn avatar zoowii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wiki's Issues

Storing an object in smart contract

Hi. Can I save a key-value pair in a smart contract via map, where the value is my instance of custom class like map = new map(<String, Car>), if not then how to get around this problem? Thank you.

java code example:
class Car{
String brand;
String model;
...
Car(String brand, String model, ...) {
this.brand = brand;
this.model = model;
...
} }

Can't find seed config file

Thank you for a great tutorial

I am stuck on the creation block configuration part of the tutorial
I can't seem to find the seed.conf file under the go-nebulas/conf/default.
I have the genesis.conf and config.conf files

Please advise what steps I may have missed.

Thank you

why not use class instead of function for contract

从语法和代码美观上面来说 class要更容易阅读, 现在的v8已经原生支持es6,为什么还要选择上一代的javascript语法来作为官方合约demo呢。 还有是否可以用webpack之类的工具来编译或者预处理合约,生成的冗余代码会不会增加gas?

make shared_lib && make install-shared报错

完全按照步骤执行,到这一步出现这个问题
make shared_lib && make install-shared:
报错如下:
root@bochain:/path/to/workspace/src/github.com/nebulasio/go-nebulas# cd rocksdb & make shared_lib && make install-shared
[1] 524
make: *** No rule to make target 'shared_lib'. Stop.
[1]+ Done

{"error":"cannot found account in storage"}

curl -i -H 'Accept: application/json' -X POST http://localhost:8685/v1/admin/transactionWithPassphrase -H 'Content-Type: application/json' -d '{"transaction":{"from":"n1H4MYms9F55ehcvygwWE71J8tJC4CRr2so","to":"n1rVLTRxQEXscTgThmbTnn2NqdWFEKwpYUM", "value":"100","nonce":1,"gasPrice":"1000000","gasLimit":"2000000","contract":{"function":"check","args":"[0]"}}, "passphrase": "passphrase"}'
HTTP/1.1 400 Bad Request
Content-Type: application/json
Date: Tue, 08 May 2018 08:57:53 GMT
Content-Length: 44

{"error":"cannot found account in storage"}

can't make build

ubuntu@ubuntu-xenial:/path/to/workspace/src/github.com/nebulasio/go-nebulas$ sudo make build cd cmd/neb; go build -ldflags "-X main.version=1.0.1 -X main.commit=f86edd419d21a57737deb7b90d8ff187a3338339 -X main.branch=master -X main.compileAt=date +%s" -o ../../neb-f86edd419d21a57737deb7b90d8ff187a3338339 /bin/sh: 1: go: not found Makefile:66: recipe for target 'build' failed make: *** [build] Error 127

running ./neb error

When installing Nebulas for the first time and running ./neb users will receive the error.

Error: err="the size of initial dynasty in genesis block is un-safe, should be greater than or equal 8" file=main.go func=main.runNeb line=109

image

The solution:
Add more address to the Dynasty block or genesis.conf file. Example below

image

image

This will fix the error above

./neb account new 错误

$ ./neb account new
Your new account is locked with a passphrase. Please give a passphrase. Do not forget this passphrase.
Passphrase:
Repeat passphrase:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa6c502]

goroutine 1 [running]:
github.com/nebulasio/go-nebulas/core.(*Address).String(0x0, 0xc4200149b0, 0x5)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/core/address.go:138 +0x22
main.accountCreate(0xc420012b00, 0x0, 0x0)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/cmd/neb/accountcmd.go:109 +0xf6
main.MergeFlags.func1(0xc420012b00, 0x0, 0xc420012b00)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/cmd/neb/flags.go:356 +0x103
github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli.HandleAction(0xceb220, 0xc4201af720, 0xc420012b00, 0xc420062500, 0x0)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli/app.go:490 +0xd2
github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli.Command.Run(0xe36a0b, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe458be, 0x14, 0x0, ...)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli/command.go:210 +0xa95
github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli.(*App).RunAsSubcommand(0xc42006d1e0, 0xc420012840, 0x0, 0x0)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli/app.go:379 +0xa7b
github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli.Command.startApp(0xe39cb2, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe40fe6, 0xf, 0x0, ...)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli/command.go:298 +0x944
github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli.Command.Run(0xe39cb2, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe40fe6, 0xf, 0x0, ...)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli/command.go:98 +0x1319
github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli.(*App).Run(0xc42006cd00, 0xc420010090, 0x3, 0x3, 0x0, 0x0)
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/vendor/github.com/urfave/cli/app.go:255 +0x6f8
main.main()
/home/ubuntu/workspace/blockchain/src/github.com/nebulasio/go-nebulas/cmd/neb/main.go:76 +0xaa0

可以免gas提现吗?

myneb.api.call({
    from: dapp_address,
    to: dapp_address,
    value: 0,
    contract: {
        function: "withdraw",
        args: JSON.stringify(['n1Rs4R8EA7TNjvAyWexkecS2dEJLKhdiyLc', 5000000])
    },
    gasPrice: 1000000,
    gasLimit: 2000000,
}).then(function(tx) {
    console.log(tx);
});

大概是这个意思,我这显示成功但并没有真正到账

智能合约调用方法总是报:contract check failed

您好,智能合约能正常部署,{"gas_price":"1000000","gas_limit":"2000000","contract_address":"n1nVx7aVXouGW5UZKtf2tpi7wMS6StcYpSm","status":1,"gas_used":"22016"},status=1,但调用save()或takeout()方法时 总是报:{"error":"contract check failed"},请帮忙看看,谢谢~

文档的中的错误

文档中的这句话

否则,其他节点启东市需要配置seed,seed节点将会把网络中其他节点的路由信息同步给刚启动的节点

应该是

否则,其他节点启动时需要配置seed,seed节点将会把网络中其他节点的路由信息同步给刚启动的节点

Transaction Error with neb version e752505a5ba7c6a3915e0b6bd02b6348ae64972f

 curl -i -H 'Accept: application/json' -X POST http://localhost:8685/v1/user/transaction  -d
 '{"from":"1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c","to":"e6dea0d0769fbf71ab01f8e0d78cd59e78361a450e1f4f88","nonce":1,"value":"10"}'
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Date: Sun, 11 Mar 2018 04:32:49 GMT
Content-Length: 55

{"error":"uint128: invalid string to uint128","code":2}

Any insight?

求详解Nebulas 101 - 02 发送交易中星云链交互

看教程看到星云链交互那里,突然就懵逼了。
HTTP API怎么用的啊 为什么我运行testing里面的main.go的结果跟教程不一样呢?

我的是这样:
moyu:client$ go run main.go
2018/05/08 10:50:22 GetNebState tail chain_id:100 tail:"6315d478167eef6539df3371b15dd168dc8d4f02726787babb73c45f9d95f408" lib:"0000000000000000000000000000000000000000000000000000000000000000" height:14 protocol_version:"/neb/1.0.0" version:"1.0.1"
2018/05/08 10:50:22 GetAccountState n1QZMXSZtW7BUerroSms4axNfyBGyFGkrh5 nonce 0 value 0
2018/05/08 10:50:22 GetAccountState n1Zn6iyyQRhqthmCfqGBzWfip1Wx8wEvtrJ nonce 0 value 0
2018/05/08 10:50:22 UnlockAccount failed: rpc error: code = Unknown desc = account is not found
2018/05/08 10:50:22 SendTransaction failed: rpc error: code = Unknown desc = account is locked
2018/05/08 10:51:02 GetAccountState n1Zn6iyyQRhqthmCfqGBzWfip1Wx8wEvtrJ nonce 0 value 0
求详解用法

对gas手续费的一点看法探讨

nebulas的gas手续费是否可以免除?从根据账户余额来限制交易频率和影响矿工打包排序等方式来研究免除手续费的可能性,至少免除普通用户之间的转账手续费更有利于nebulas的推广和使用dapp的积极性,这也符合现实世界中银行之间转账免除手续费的趋势。

make build cannot find package "github.com/nebulasio/go-nebulas/cmd/console"

wupandeMacBook-Pro:wupan wupan$ export GOPATH=/Users/wupan/Desktop/Workspace
wupandeMacBook-Pro:wupan wupan$ env
GOPATH=/Users/wupan/Desktop/Workspace
_=/usr/bin/env

error
sudo make build
cd cmd/neb; go build -ldflags "-X main.version=1.0.1 -X main.commit=373bc29bce8323e3960fae26e1072f9560f1b8e4 -X main.branch=master -X main.compileAt=date +%s" -o ../../neb-373bc29bce8323e3960fae26e1072f9560f1b8e4accountcmd.go:25:2: cannot find package "github.com/nebulasio/go-nebulas/cmd/console" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/cmd/console (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/cmd/console (from $GOPATH)
accountcmd.go:26:2: cannot find package "github.com/nebulasio/go-nebulas/core" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/core (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/core (from $GOPATH)
configcmd.go:24:2: cannot find package "github.com/nebulasio/go-nebulas/neblet" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/neblet (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/neblet (from $GOPATH)
crashclient.go:31:2: cannot find package "github.com/nebulasio/go-nebulas/neblet/pb" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/neblet/pb (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/neblet/pb (from $GOPATH)
misccmd.go:26:2: cannot find package "github.com/nebulasio/go-nebulas/net" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/net (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/net (from $GOPATH)
networkcmd.go:25:2: cannot find package "github.com/nebulasio/go-nebulas/util" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/util (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/util (from $GOPATH)
crashclient.go:32:2: cannot find package "github.com/nebulasio/go-nebulas/util/logging" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/nebulasio/go-nebulas/util/logging (from $GOROOT)
/Users/wupan/go/src/github.com/nebulasio/go-nebulas/util/logging (from $GOPATH)
crashclient.go:33:2: cannot find package "github.com/sirupsen/logrus" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/sirupsen/logrus (from $GOROOT)
/Users/wupan/go/src/github.com/sirupsen/logrus (from $GOPATH)
accountcmd.go:27:2: cannot find package "github.com/urfave/cli" in any of:
/usr/local/Cellar/go/1.10.2/libexec/src/github.com/urfave/cli (from $GOROOT)
/Users/wupan/go/src/github.com/urfave/cli (from $GOPATH)

删除数据库和neb项目后,重新按第一张顺序编辑,启动节点报错Failed to setup net service

INFO[2018-05-07T18:43:58+08:00] Started crash reporter. file=crashclient.go func=main.InitCrashReporter line=115
ERRO[2018-05-07T18:43:58+08:00] Failed to start pprof err="" file=main.go func=main.runNeb line=103 listen="0.0.0.0:8888"
INFO[2018-05-07T18:43:58+08:00] Setuping Neblet... file=neblet.go func="neblet.(*Neblet).Setup" line=110
ERRO[2018-05-07T18:43:58+08:00] Failed to check port. err="listen port is not available" file=net_service.go func=net.NewNebService line=38 listen="[0.0.0.0:8680]"
FATA[2018-05-07T18:43:58+08:00] Failed to setup net service. err="listen port is not available" file=main.go func=main.runNeb line=108

Error: node already exists in route table

I'm working through the tutorial on connecting to the Testnet and have come up against the errors can not say hello to trusted node and node is already exist in route table.

Any suggestions for how I can troubleshoot this? I'd be happy to add some clarity to the documentation if it happens to be missing something.

go-nebulas_ -bash _272x71

Some questions from beginner

Hi guys,
I'm a beginner of Nebulas, my friend invent me to join the 'incentive' plan, I've registered the account with his invent code, then I created my wallet on the Mainnet and try to deploy the contract, but I found that I haven't got any money (NAS) to pay this trade by GAS, so I thinks it's impossible to join the game for me...
Could you tell me what can I do next step?

Unable to build

Hi!

So I followed steps described in installation tutorial, however I am unable to run make build.

When I run make build, it gives me following response:

screen shot 2018-01-07 at 20 49 15

Any ideas how to solve this issue? Sorry if it is a dumb question, I don't have a whole lot experience with GO.

Thanks!

LocalContractStorage Cannot set property!

var BankVaultContract = function () { LocalContractStorage.defineMapProperty(this, "userArray", null);
...
init: function () { this.userArray = [];
Test result:

{"result":"TypeError: Cannot set property userArray of # which has only a getter","execute_err":"Deploy: TypeError: Cannot set property userArray of # which has only a getter","estimate_gas":"25648"}

Where am I wrong?

make build error

make build

cd cmd/neb; go build -ldflags "-X main.version=1.0.1 -X main.commit=-X main.branch=master -X main.compileAt=`date +%s`" -o ../../neb-
# github.com/nebulasio/go-nebulas/vendor/github.com/tecbot/gorocksdb
../../vendor/github.com/tecbot/gorocksdb/options.go:1045:2: could not determine kind of name for C.rocksdb_options_set_allow_ingest_behind
make: *** [build] Error 2

NR探讨

Nebulas

Nebulas,基于价值尺度的区块链操作系统及搜索引擎。

背景:

当前区块链,一方面无法满足大规模商业应用的扩容性,另外一方面存在价值尺度缺失,各个区块链项目五花八门,技术角度不一,吸引人群有差异,宣传力度也不一致,没有一个统一的价值尺度来衡量这些区块链项目。

星云链的目标

  • 建立一个适用于所有开发者并且被不断完善的区块链操作系统。
  • 基于这样一个区块链操作系统汇聚大量的智能合约程序,为有区块链技术需求的用户提供搜索服务。其中Nebulas制定诸多机制,保证其自主升级和完善。

主要内容包含:

  • 定义价值尺度的星云指数 Nebulas Rank(NR),通过综合考虑链中各个账户的流动性及传播性,如果这个NR真做起来了,那么就像淘宝刷单一样,如何防止作弊?
  • 支持核心协议和智能合约链上升级的星云原力 Nebulas Force(NF),帮助星云链自身及其身上的应用实现自我进化,动态适应社区或市场变化,开发者通过星云链构建更丰富的应用,并进行快速迭代。如果Nebulas不仅仅做一个区块链的搜索引擎,还要做一个公链平台,那要重点放在共识算法上。如果底层的共识算法不安全,TPS做不上去,帮助开发者那是扯淡了。
  • 开发者激励协议 Developer Incentive Protocol(DIP),就是用自己的财政支持优秀开发者咯,其实只要你公链足够优秀,开发者自然会跟公链相互促进的。
  • 贡献度证明共识算法Proof of Devotion(PoD),快速,不可逆和公平性,不知道PoD为何物。
  • 去中心化应用的搜索引擎,这个要看这个引擎是中心化的还是去中心化的,如果是中心化的,那么已有的引擎再次开发难度不大。如果是像智能合约一样,去中心化的实现了搜索引擎的整个算法,那这点确实不错。

星云链设计原则

  • 公正的排名算法

NR确实有比较大的商业潜力,但如何对抗人性中的弱点才是亮点。如果搞出一个不错的指数,但抵不住人性的恶,分分钟被作弊薅羊毛了,这个指数有还不如没有。

  • 区块链系统及应用的自我进化

将星云链上的应用简单理解成智能合约,这些智能合约是链上数据的一部分,通过链上数据的追加实现基础协议的升级。这个说法很有问题,升级智能合约是大家都想的,但如何达成共识来升级呢?星云链通过在智能合约底层存储支持状态变量可跨合约访问的设计,完成智能合约的升级,这一句感觉有点玄乎呢?

  • 生态系统

PoD算法,利用NR的价值尺度评估出对生态贡献度较高的账户,平等赋予记账资格。如果NR是可以人为参与影响,那么遏制记账权被垄断就很难说得过去。

Nebulas Rank

NR是其他算法的基础部分,三重价值尺度:

  • 流动性
    交易的频次和规模,这个就完全可以造假

  • 传播性
    资产流动的广度和深度,也完全可以造假

  • 互操作性
    信息间的互操作,具体这些操作是什么?

其实说了这么多,就是按照对每个帐号地址进行统一价值尺度的图计算处理。然而现在的图计算是中心化的计算,基本都是采用分布式计算,比如Spark来计算,这个NR的计算难道也要用贵公司的服务器来跑?

抵抗作弊

作弊手法:

  • 环形记账
  • 提高出度
  • 搞群控
  • 蹭热点

NR弱化作弊的机制:

  • 滑动时间窗T,就是看你表现不是一两条,短期内作弊效果不明显呗,长期作弊的好处也相对长期有效
  • 环形攻击,就你们几个瘪三在那转来转去,当然可以让其边的强度信息降低
  • 算法还考虑“币龄”,可以拖慢作弊者的交易速度,但也是说只要有耐心作弊,效果更好
  • 为了获得最大的“激励值”,账户需要在当前周期内转出金额多于收入,或者只转出少于收入一半的金额,就是说要么账户资产流出,要么资产流入,怎么就会搞群控的时候,出现什么账户的储蓄效应呢?
  • 取最大弱联通分支,伪造的独立分支会被视为噪声而过滤清除。就是说那些搞群控的都是二傻,搞一些没有“人脉“的节点给自己做独立分支,恐怕那些搞群控的就会钻你这个空子,让自己的节点比那些真正的中心节点更加显得中心。
  • 蹭热点,对低入度的节点评分偏向“保守”,就是说你从交易平台这样的中心节点,取点小钱,人家没把你放在眼里。但人家既然搞作弊,当然要真刀真枪干啊,蹭热点又不是说不花成本。

这个NR说这么多,就是简单考量地址的热度,这个跟整个项目的热度也不是绝对的对应关系。比特币转账成本这么高,让它在钱包里呆着好了,或者直接在交易平台呆着好了,但其他交易费低的就不是这样。要用一个统一的数值来衡量所有的项目,难度还是很大。至少这个NR设计看不出有这个能力。

这些基础的疑问,如果Nebulas不出来解答,白皮书下面部分是没必要看了。

"error":"invalid character '\\\\' looking for beginning of value"

在进行智能合约储存区键值对储存测试时,进行query遇到"error":"invalid character '\\' looking for beginning of value"的错误提示

代码如下

save: function (jsonstr) {
this.redisdb.put("test", jsonstr);
},
query: function () {
var x = this.resumedb.get("test");
return x;
}

调用save时成功 status=1
但query时报错

查询语句
curl -i -H 'Accept: application/json' -X POST http://localhost:8685/v1/user/call -H 'Content-Type: application/json' -d '{"from":"n1FF1nz6tarkDVwWQkMnnwFPuPKUaQTdptE","to":"n1tL2fXV7Eh1sonkqBxc8hGUkMsQhJMq7cm", "value":"0","nonce":28,"gasPrice":"1000000","gasLimit":"2000000","contract":{"function":"query","args":""}}'

因为合约部署时引号都进行了转义 怀疑可能这里出了问题

Problem while downloading go third party lib

I'm trying to follow the this guide to deploy Neblus on my machine, however I met an error while trying to downloading go third party lib.
When I'm executing sudo make dep
Got an error:
dep ensure -v /path/to/workspace/src/github.com/nebulasio/go-nebulas is not within a known GOPATH/src make: *** [dep] Error 1

When I'm executing
echo $GOPATH
Result:
/path/to/workspace

Here is my GOPATH from go env
image

I'm using a mac machine, and not very familiar with Go, so not sure if I'm filing the issue in the correct place. But I really need some help.

调用合约参数args使用jsonarray报错

多参数调用时使用jsonarr比如"args":"[{"abc":"abc","123":"123"}]"
提示"error":"invalid character 'a' after object key:value pair"}
输入"[]"或"[{}]"是可以的

服务器不支持OPTIONS请求

开放端口使用curl或者远程用chrome的rest http插件调用都没问题 跨域也没问题
但是浏览器实现的时候发送fetch请求,预检OPTIONS挂了,501 not implemented 服务器不支持OPTIONS请求,想了想这个是不是nebulas本身不支持呢?

Questions for Clarity

Hi,

Love the project. Just trying to get TestNet configured properly and wanted a bit more clarity on the setup:

  1. Does the Token claim at https://testnet.nebulas.io/claim/ require me to run ./neb every day for tthe 10 NAS Testnet Tokens?
  2. Will the TestNet Tokens become real NAS Tokens? Before or after Mainnet launch?

For the config ./neb

  1. Which addresses in the config files do I need to swap out for my own? Do I want to include my testnet wallet address or just a coinbase address? For coinbase, should it be the ETH address?
  2. I guess it is just not clear enough to me which information I should be swapping out for my own.

NAS dispatch,

token_distribution [
{
address: "1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c"
value: "10000000000000000000000"
},
{
address: "2fe3f9f51f9a05dd5f7c5329127f7c917917149b4e16b0b8"
value: "10000000000000000000000"
}
]

Mining machine's mining address, the reward will be send to a Coinbase address

coinbase: "eb31ad2d8a89a0ca6935c308d5425730430bc2d63f2573b8"

Node signature algorithm

signature_ciphers: ["ECC_SECP256K1"]

Mining machine's mining address

miner: "eb31ad2d8a89a0ca6935c308d5425730430bc2d63f2573b8"

Initial Token Distribution is described here

token_distribution [
{
address: "0b9cd051a6d7129ab44b17833c63fe4abead40c3714cde6d"
value: "10000000000000000000000000"
},
{
address: "4aa6312b10dd81f68eb62a90e234a48eb83c6b0e568b5eb8"
value: "10000000000000000000000000"
}
]

Love the project, just want to help. Thanks in advance.

提现无效?

withdraw: function(address, value) { value = new BigNumber(value); return Blockchain.transfer(address, value); }
window.postMessage({ "target": "contentscript", "data": { "to": 'n1g69oazeomw5tiw6WALoEpCRY1NMGEhf8u', "value": "0", "contract": { "function": "withdraw", "args": JSON.stringify(['n1Trqxc223GiSWKsmFDvDvD9qn6CMbrEEzk', 0.08]) } }, "method": "neb_sendTransaction" }, "*");
显示成功但并没有到账

文档有些问题

Nebulas 101 - 04 智能合约存储区.md中
image
其中红色部分 按照上下文理解 应该是defineProperty 而不是defineMapProperty吧

RPC api.sendTransaction does not return contract_address

I'm unable to access the contract via RPC as no contract_address is returned using sendTransaction.

contract

var contract = {
    "args": "",
    "sourceType": "js",
    "src": "var DepositeContent=function(t){if(t){let n=JSON.parse(t);this.balance=new BigNumber(n.balance),this.expiryHeight=new BigNumber(n.expiryHeight)}else this.balance=new BigNumber(0),this.expiryHeight=new BigNumber(0)};DepositeContent.prototype={toString:function(){return JSON.stringify(this)}};var BankVaultContract=function(){LocalContractStorage.defineMapProperty(this,\"bankVault\",{parse:function(t){return new DepositeContent(t)},stringify:function(t){return t.toString()}})};BankVaultContract.prototype={init:function(){},save:function(t){var n=Blockchain.transaction.from,e=Blockchain.transaction.value,a=new BigNumber(Blockchain.block.height),r=this.bankVault.get(n);r\u0026\u0026(e=e.plus(r.balance));vari=new DepositeContent;i.balance=e,i.expiryHeight=a.plus(t),this.bankVault.put(n,i)},takeout:function(t){var n=Blockchain.transaction.from,e=new BigNumber(Blockchain.block.height),a=new BigNumber(t),r=this.bankVault.get(n);if(!r)throw new Error(\"No deposit before.\");if(e.lt(r.expiryHeight))throw new Error(\"Cant takeout before expiryHeight.\");if(a.gt(r.balance))throw new Error(\"Insufficient balance.\");if(0!=Blockchain.transfer(n,a))throw new Error(\"transfer failed.\");Event.Trigger(\"BankVault\",{Transfer:{from:Blockchain.transaction.to,to:n,value:a.toString()}}),r.balance=r.balance.sub(a),this.bankVault.put(n,r)},balanceOf:function(){var t=Blockchain.transaction.from;return this.bankVault.get(t)},monkas:function(){return\"MONKAS OOH OOH AHH AHH\"}},module.exports=BankVaultContract;"
}

./neb console

api.sendTransaction("1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c", "1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c", "0", 7, 1000000, 2000000, contract)


/* RETURNED VALUE
{
    "txhash": "0c791527888a8022f388d9dd072c79e0c7356860ce59fe182b5373942ef83504"
}
*/

The transaction receipt looks like:

api.getTransactionReceipt

{
    "chainId": 100,
    "from": "1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c",
    "gas_limit": "2000000",
    "gas_price": "1000000",
    "hash": "f3a89c1e88a4fdaf8ce90c272dfa17b1a9371b1253bf6c02bc50e382c19c9283",
    "nonce": "5",
    "timestamp": "1518045154",
    "to": "1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c",
    "type": "binary",
    "value": "0"
}

Expected behavior

api.sendTransaction("1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c", "1a263547d167c74cf4b8f9166cfa244de0481c514a45aa2c", "0", 7, 1000000, 2000000, contract)


/* RETURNED VALUE
{
    "contract_address:" <contract_address>,
    "txhash": "0c791527888a8022f388d9dd072c79e0c7356860ce59fe182b5373942ef83504"
}

Can not find the dep file

I try to run nebulas testnet and after installing dep the instructions say that I run make dep
but there is no such a file.What can I do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.