Skip to content
Ʉnlock is a protocol for memberships built on a blockchain.
JavaScript TypeScript Solidity Shell HTML Dockerfile CSS
Branch: master
Clone or download

Latest commit

Latest commit 21ca16e Jun 4, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci disabling docker_layer_caching (#6705) May 27, 2020
.github Rolling back the github actions experiment (#6418) Apr 5, 2020
design Design Folder (#4684) Sep 24, 2019
docker Revert "moving env files to the root (#6737)" (#6738) Jun 5, 2020
locksmith Update locksmith (#6216) Jun 4, 2020
newsletter
nudge Update dependency ts-jest to v26 (#6726) Jun 2, 2020
paywall Update dependency prettier to v2 (#6293) Jun 4, 2020
scripts Unlock-js tests use the same script (#6697) May 26, 2020
smart-contract-extensions Update dependency prettier to v2 (#6293) Jun 4, 2020
smart-contracts Update dependency prettier to v2 (#6293) Jun 4, 2020
tests remove the unlock.1.0.min.js script to enable redirects (#6688) May 21, 2020
unlock-app Update dependency prettier to v2 (#6293) Jun 4, 2020
unlock-assets Update dependency eslint to v7 (#6723) Jun 3, 2020
unlock-js Update dependency prettier to v2 (#6293) Jun 4, 2020
unlock-protocol.com Update dependency prettier to v2 (#6293) Jun 4, 2020
wedlocks Update dependency prettier to v2 (#6293) Jun 4, 2020
wiki @ 85a9ac1 adding github wiki to main repo (#579) Nov 20, 2018
.clabot adding @vikmeup to clabot (#5511) Dec 18, 2019
.dockerignore exploding our single dockerfile into several dockerfiles in an effort… Apr 11, 2019
.eslintrc.js Simplify ESLint config in paywall (#5660) Jan 10, 2020
.gitattributes GitHub: add formatting for Solidity (#5473) Dec 13, 2019
.gitignore GitIgnore: add sc-extensions build (#5979) Feb 15, 2020
.gitmodules adding github wiki to main repo (#579) Nov 20, 2018
.huskyrc.js switching to using package for svg assets (#6417) Apr 3, 2020
.npmrc Applies engine version enforcement to dashboard & paywall (#1897) Mar 5, 2019
.prettierrc using a single .prettierrc (#2475) Apr 3, 2019
.unlock-protocol.config.json one more update to our config to reflect the new call to action (#4507) Aug 23, 2019
CLA.txt finalized the confg for clabot (#4107) Jul 5, 2019
CODE_OF_CONDUCT.md Adding Contributor Covenant CoC (#180) Aug 20, 2018
CONTRIBUTING.md first draft of changes on contributor docs (#1291) Jan 30, 2019
LICENSE Adding MIT License (#108) Jun 7, 2018
PULL_REQUEST_TEMPLATE.md Add item to pr template (#5951) Feb 12, 2020
README.es.md updating the badge to use circleci (#2068) Mar 14, 2019
README.md removed arg to build image (#6679) May 18, 2020
SECURITY.md Adding vulnerability disclosure policy (#4405) Aug 9, 2019
mkdocs.yml Initial mkdocs.yml file for documentation (#262) Sep 21, 2018
package.json Update dependency prettier to v2 (#6293) Jun 4, 2020
renovate.json Renovate: switch to monthly updates (#6643) May 5, 2020
yarn.lock Update dependency prettier to v2 (#6293) Jun 4, 2020

README.md

Unlock


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.

License: MIT Build Status

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

We use docker to run a set of containers which provide the required infrastructure (database, local ethereum test network, subgraph...)

  1. Check out the code from this repository

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

git clone https://github.com/unlock-protocol/unlock
cd unlock
  1. Install all dependencies

This will install all dependencies required for all the Unlock components (smart contracts and react app). You'll need yarn installed globally.

yarn
  1. Set up your environment variables

At the root of the repo, add a file called .env.dev.local which includes the following variables and add your wallet address to the first line:

ETHEREUM_ADDRESS=<your ethereum address>
READ_ONLY_PROVIDER=http://localhost:8545
LOCKSMITH_URI=http://localhost:8080
WEDLOCKS_URI=http://localhost:1337
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
ERC20_CONTRACT_SYMBOL=DAI
ERC20_CONTRACT_ADDRESS=0xFcD4FD1B4F3d5ceDdc19004579A5d7039295DBB9
BOOTSTRAP_AMOUNT=15.0
HTTP_PROVIDER_HOST=127.0.0.1
HTTP_PROVIDER_PORT=8545
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.

  1. Run the docker cluster.

Once docker has been installed on your machine, start the cluster:

$ cd docker && docker-compose up --build

This cluster includes all the required "infrastructure" to run our apps locally. When starting this script does several things: deploys the unlock smart contract, transfers eth to your address, ... etc. It is actually defined in both docker-compose.yml and docker-compose.override.yml.

  1. Run the app

This applies to any of our applications, but we'll take unlock-app as an example as it is our "main" dashboard:

cd unlock-app && yarn dev

Important: You should then head to http://localhost:3000/dashboard so you can start using the application and deploy locks locally. (going to the root will redirect you to http://localhost:3002 which is our static landing page site.)

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

You can’t perform that action at this time.