当前位置: 首页 > 软件库 > Web3 > 区块链 >

unlock

授权协议 MIT License
开发语言 JavaScript
所属分类 Web3、 区块链
软件类型 开源软件
地区 不详
投 递 者 呼延渝
操作系统 跨平台
开源组织
适用人群 未知
 软件概览


This repository includes all the code deployed by Unlock, including smart contracts and the web app running at unlock-protocol.com.

Unlock is a membership protocol, built on a blockchain. It enables creators to monetize their content or software without relying on a middleman. It lets consumers manage all of their subscriptions in a consistent way, as well as earn discounts when they share the best content and applications they use.

Read more about why we're building Unlock.

Demo

You can try Unlock using the Ethereum blockchain on our homepage.

We are building this in the open, which means you can also run the code locally (see instructions below).You can try out the staging version - which runs the latest, in-progress code, but against the Rinkeby test network - at https://staging.unlock-protocol.com.

Finally, you can learn more on our documentation wiki.

Contributing

Thanks for your interest in contributing to Unlock! We're excited you're here. There are a variety of ways to contribute to the project.Please read more about contributing in our contributor guide. Please also check our code of conduct for all participants in our community.

Getting started

The code

Unlock uses a monorepo which includes all the services and applications we develop.

# get the code
git clone https://github.com/unlock-protocol/unlock
cd unlock

You'll need yarn installed globally.

yarn
# install all dependencies (...may take a while)

To execute commands inside the repo, we use the pattern yarn workspace <workspace name> <command>

# build the contracts
yarn workspace @unlock-protocol/smart-contracts build

# validate lint for paywall
yarn workspace @unlock-protocol/paywall lint

# etc.

The protocol

You can run a local version of the protocol using Docker.

cd docker && docker-compose up --build 

This will create the required infrastructure (database, local ethereum test network, subgraph...) and start core services such as the Locksmith API and a Wedlocks mailing service for debug purposes.

NB: config is defined in both docker-compose.yml and docker-compose.override.yml.

Deploy and provision the contracts

The following script will deploy the contracts, create some dummy locks and send you some local tokens for development.

cd docker
docker-compose exec eth-node yarn provision

Run one of the app

The main dashboard lives in the unlock-app folder of this repo.

To launch it locally:

# install deps
yarn 

# start Unlock main app
yarn worskspace @unlock-protocol/unlock-app start

This will start

  • http://localhost:3000/dashboard to start using the application and deploy locks locally.
  • http://localhost:3002 our static landing page site.

Config and environment variables

If you run the app locally on you machine, you will have to create a file called .env.dev.local at the root of the repo, containing variables for the different apps :

# your wallet address to the first line
ETHEREUM_ADDRESS=<your ethereum address>

# the ETH node
READ_ONLY_PROVIDER=http://localhost:8545

# core service URLs
LOCKSMITH_URI=http://localhost:8080
WEDLOCKS_URI=http://localhost:1337

# other optional services
DASHBOARD_URL=http://localhost:3000
PAYWALL_URL=http://localhost:3001
PAYWALL_SCRIPT_URL=http://localhost:3001/static/paywall.min.js
UNLOCK_STATIC_URL=http://localhost:3002
UNLOCK_TICKETS_URL=http://0.0.0.0:3003

# deployment
HTTP_PROVIDER_HOST=127.0.0.1
HTTP_PROVIDER_PORT=8545
ERC20_CONTRACT_SYMBOL=DAI
ERC20_CONTRACT_ADDRESS=0xFcD4FD1B4F3d5ceDdc19004579A5d7039295DBB9
BOOTSTRAP_AMOUNT=15.0
LOCKSMITH_PURCHASER_ADDRESS=0xe29ec42f0b620b1c9a716f79a02e9dc5a5f5f98a

Make sure you change the value of ETHEREUM_ADDRESS to use your main Ethereum address (the one you use with your Metamask for example). This will let you interract with the application using your regular setup.

NB: The environments config files for the infrastructure are located inside the ./docker folder.

Thank you

BrowserStack Logo

Thanks to BrowserStack for providing the infrastructure that allows us to test in real browsers.

Thank you to all the Members of our lock as well!You can easily join this list by clicking on the ❤️ Sponsor button (it's free!) at the top of this page too.

Members

  • @Override public void unlock() {   //解锁成功返回true Boolean opStatus = get(unlockInnerAsync(Thread.currentThread().getId())); if (opStatus == null) { throw new Illega

  • 传说有一本江湖罕见的武功秘籍,该书珍藏在主持大师手中。一天大师盛情邀请江湖好汉前来观摩该书,但是一次只能有一个人来看。 该怎么办呢?用synchronized来实现吗?都用臭了,算了。用下李狗(Doug Lea)写的Lock吧。 实现很简单,首先获得一个锁实例  Lock lock = new ReentrantLock(); 接着获得一把锁: lock.lock(); 观摩该书中。。。 lock

 相关资料
  • 问题内容: 我正在开发使用Google Play游戏服务的Android游戏。 例如,当玩家达到10000点时,成就将被解锁。所以当玩家达到10000点时,我打电话 问题是当用户在另一游戏中再次达到10000点时该怎么办。我是否必须检查该成就是否已经解锁,还是可以再次调用unlock()? 我知道,只有在首次解锁成就时才会显示“播放服务”弹出窗口。但我担心api调用的配额。例如,如果我存储从共享首

  • 问题内容: 我试图使用命令行中的说明这篇文章。 似乎多数民众赞成在(https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly)上可用。 如何在Oracle JDK7和JVM HotSpot中使用这些选项(或类似的选项)? 问题答案: 这些说明适用于Linux(Ubuntu 10.04.4 LTS),但应适用于您的OS。在下载Or

  • 描述 (Description) 分离的规则集可以通过导入到范围来获得对范围的访问。 例子 (Example) 以下示例演示了解锁。 这将修改LESS文件中的分离规则集范围 - passing_ruleset.htm <!doctype html> <head> <link rel = "stylesheet" href = "style.css" type = "text/cs

  • Android Unlock Patterns 描述 Android devices have a special lock screen with a 3 x 3 grid of dots. Users can set an "unlock pattern" by connecting the dots in a specific sequence, forming a series of jo

  • Unlock Music 用于在浏览器中解锁加密的音乐文件。 特性 支持的格式  QQ 音乐 (.qmc0/.qmc2/.qmc3/.qmcflac/.qmcogg/.tkm)  Moo 音乐格式 (.bkcmp3/.bkcflac)  QQ 音乐 Tm 格式 (.tm0/.tm2/.tm3/.tm6)  QQ 音乐新格式 (.mflac/.mgg)  QQ 音乐海外版JOOX Music (.)

  • Linux Huawei Unlocker 是一个试图删除华为移动带宽调制解调器(华为USB调制解调器)的运营商锁的工具。可在 Linux 下运行,自动查找 IMEI,计算解锁码,检查 SIM 卡锁状态,并显示剩余的可尝试解锁的次数,并让用户确认是否尝试解锁码。

  • 实现iPhone中滑动解锁的效果。代码只用了public API。 [Code4App.com]

相关阅读

相关文章

相关问答

相关文档